#ifndef _DRIVER_FLASH_H_
#define _DRIVER_FLASH_H_

#include "stm32f10x.h"

#ifdef __cplusplus
extern "C" {
#endif

#define FLASH_PAGE_SIZE						(0X400)     // flash页大小为1KB

#define FLASH_START_ADDR					(0X8000000) // flash起始地址

#define FLASH_END_ADDR						(0X800FFFF)     // flash结束地址

uint8_t ReadByte(const uint32_t nAddr);	

int16_t EraseAllPage(void);

int16_t ErasePage(const uint32_t nAddr);
	
int16_t ProgramWord(const uint32_t nAddr, const uint32_t nData);

int16_t ProgramHalfWord(const uint32_t nAddr, const uint16_t nData);
		

#ifdef __cplusplus
}
#endif

#endif //_DRIVER_FLASH_H_

